<template>
    <view class="page-wrap">
        <u-gap height="20" bg-color="#f5f5f5"></u-gap>
        <view class="padding-30"><u-parse :html="content" :show-with-animation="true" :lazy-load="true"></u-parse></view>
        <global-components ref="global-components" :loading="false"></global-components>
    </view>
</template>

<script>
import { mapState } from 'vuex';
export default {
    components: {},
    data() {
        return {
            type: '',
            content: null // 富文本解析内容
        };
    },
    computed: {
        ...mapState(['userInfo', 'login'])
    },
    methods: {
        // 获取用户协议数据
        getUserAgreement() {
            this.$api.util.userAgreement({ key: this.type }).then(res => {
                this.content = res.info;
            });
        }
    },
    watch: {},
    // 页面周期函数--监听页面加载
    onLoad(option) {
        this.type = option.type;
        this.getUserAgreement(option);
    },
    // 页面周期函数--监听页面初次渲染完成
    // 页面周期函数--监听页面显示(not-nvue)
    onShow() {},
    // 页面周期函数--监听页面隐藏
    onHide() {},
    // 页面周期函数--监听页面卸载
    onUnload() {},
    // 页面处理函数--监听用户下拉动作
    onPullDownRefresh() {
        uni.stopPullDownRefresh();
    },
    // 页面处理函数--监听用户上拉触底
    onReachBottom() {}
    // 页面处理函数--监听页面滚动(not-nvue)
    /* onPageScroll(event) {}, */
    // 页面处理函数--用户点击右上角分享
    /* onShareAppMessage(options) {}, */
};
</script>

<style scoped lang="scss">
.page-wrap {
}
</style>
